package com.example.demo.day.config.learn.test1.repository;

import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;

@Component
@Data
//@ConfigurationProperties(prefix = "user1")
//@ImportResource(locations = {"classpath:beans.xml"})
//@Validated
public class UserDTO {


//    @Value("${user.username}")
    private static String username;

    public String getUsername() {
        return username;
    }

    @Value("${user.username}")
    public void setUsername(String username) {
        System.out.println(this.getUsername());
        this.username = username;
        System.out.println(this.getUsername());
    }

    @Override
    public String
    toString() {
        return "UserDTO{" +
                "username='" + username + '\'' +
                '}';
    }
}
